/**************************************************************************/ /**
 * @file     file_table.h
 * @brief    素材储存管理
 * @version  V1.0
 * @date     2022.03.11
 ******************************************************************************/
#ifndef __FILE_TABLE_H__
#define __FILE_TABLE_H__

//----------------------------------头文件依赖---------------------------------//
#include "main.h"

//----------------------------------素材参数配置---------------------------------//
#include "800_480_setting.h"

//----------------------------------类型声明---------------------------------//
//文件类型
typedef enum
{
	img = 0,
	avi,
	wav,
	bin
} file_type_t;

// user_img 描述信息
typedef struct
{
	lv_img_dsc_t *img;	//图片变量的指针
	const char *f_name; //文件名

	/* 不使用 FATFS 文件系统时，须增加如下成员以管理 SPI-Flash 内素材的存储
	uint32_t f_size;//文件大小
	uint32_t f_addr;//文件存放地址
	*/
} user_img_t;

// user_wav 描述信息
typedef struct
{
	const char *f_name; //文件名

	/* 为存放至 SDRAM 内作准备 */
	uint16_t *data_start; //音频数据起始地址
	uint32_t data_size;	  //音频数据大小
	uint32_t sample_rate; //采样率
} user_wav_t;

// user_avi 描述信息
typedef struct
{
	const char *f_name; //文件名
} user_avi_t;

// user_bin 描述信息
typedef struct
{
	const char *f_name; //文件名
} user_bin_t;

// 文件分类索引类
typedef struct
{
	user_img_t *img; //图片文件
	const uint32_t img_num;

	user_avi_t *avi; //视频文件
	const uint32_t avi_num;

	user_wav_t *wav; //音频文件
	const uint32_t wav_num;

	user_bin_t *bin; //bin文件
	const uint32_t bin_num;

	const uint32_t table_size; //表大小
} table_class_t;

//----------------------------------全局变量声明---------------------------------//
extern uint32_t Font_Addr;

/* LVGL 图片变量(相当于已加载至 SDRAM)*/
extern lv_img_dsc_t bg_color_800x480;
extern lv_img_dsc_t power_off_alpha;
extern lv_img_dsc_t power_on_alpha;
extern lv_img_dsc_t page_back_alpha;

extern lv_img_dsc_t page_logo_animimg_logo_imgs[PAGE_LOGO_SIZE];
extern lv_img_dsc_t page_navigation_animimg_loading_imgs[PAGE_NAVIGATION_LOADING_SIZE];
extern lv_img_dsc_t page_navigation_animimg_rotation_imgs[PAGE_NAVIGATION_ROTATION_SIZE];
extern lv_img_dsc_t page_navigation_animimg_press_imgs[PAGE_NAVIGATION_PRESS_SIZE];

extern lv_img_dsc_t navigation_lamp_alpha;
extern lv_img_dsc_t navigation_music_alpha;
extern lv_img_dsc_t navigation_video_alpha;
extern lv_img_dsc_t navigation_photo_alpha;

extern lv_img_dsc_t page_lamp_lighting;

extern lv_img_dsc_t page_lamp_release[4];
extern lv_img_dsc_t page_lamp_press[4];

extern lv_img_dsc_t page_lamp_1_icon[2];
extern lv_img_dsc_t page_lamp_1_control[3];

extern lv_img_dsc_t page_lamp_2_icon[2];
extern lv_img_dsc_t page_lamp_2_control[3];

extern lv_img_dsc_t page_lamp_3_icon[2];
extern lv_img_dsc_t page_lamp_3_control[4];

extern lv_img_dsc_t page_lamp_4_icon[2];
extern lv_img_dsc_t page_lamp_4_control[2];


extern lv_img_dsc_t page_music_icon[2];
extern lv_img_dsc_t page_music_control[4];
extern lv_img_dsc_t page_music_song_list;
extern lv_img_dsc_t page_music_song_name;

extern lv_img_dsc_t page_music_play_icon;


extern lv_img_dsc_t page_video_icon;		
extern lv_img_dsc_t page_video_list_pic[2][4];
extern lv_img_dsc_t page_video_list_font[2][4];

extern lv_img_dsc_t page_video_play_bg;


extern lv_img_dsc_t page_photo_icon[4];

extern lv_img_dsc_t page_photo_imgbtn_list_press[3][4];
extern lv_img_dsc_t page_photo_imgbtn_list_release[3][4];


extern lv_img_dsc_t page_imgbtn_left_press;
extern lv_img_dsc_t page_imgbtn_left_release;
extern lv_img_dsc_t page_imgbtn_right_press;
extern lv_img_dsc_t page_imgbtn_right_release;
		
extern lv_img_dsc_t page_photo_show_icon[3];
extern lv_img_dsc_t page_photo_show_pic[3][3];



//索引表
extern table_class_t File_Table;

// FATFAS_DEBUG 表
extern const char *Debug_FR_Table[];

#endif //__FILE_TABLE_H__
